/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author FIRE
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadFileParams } from '/#/axios';

const { ctxPath,adminPath } = useGlobSetting();

export interface WecharPriceModel extends BasicModel<WecharPriceModel> {
  code?: string; // 模板编号
  name?: string; // 模板名称
  sysCode?: string; // 价格体系
  createByName?: string; // 创建人
  updateByName?: string; // 修改人
}

export const wecharPriceModelList = (params?: WecharPriceModel | any) =>
  defHttp.get<WecharPriceModel>({ url: adminPath + '/setting/pricemodel/wecharPriceModel/list', params });

export const wecharPriceModelListData = (params?: WecharPriceModel | any) =>
  defHttp.post<Page<WecharPriceModel>>({ url: adminPath + '/setting/pricemodel/wecharPriceModel/listData', params });

export const wecharPriceModelForm = (params?: WecharPriceModel | any) =>
  defHttp.get<WecharPriceModel>({ url: adminPath + '/setting/pricemodel/wecharPriceModel/form', params });

export const wecharPriceModelSave = (params?: any, data?: WecharPriceModel | any) =>
  defHttp.postJson<WecharPriceModel>({ url: adminPath + '/setting/pricemodel/wecharPriceModel/save', params, data });

export const wecharPriceModelDisable = (params?: WecharPriceModel | any) =>
  defHttp.get<WecharPriceModel>({ url: adminPath + '/setting/pricemodel/wecharPriceModel/disable', params });

export const wecharPriceModelEnable = (params?: WecharPriceModel | any) =>
  defHttp.get<WecharPriceModel>({ url: adminPath + '/setting/pricemodel/wecharPriceModel/enable', params });

export const wecharPriceModelDelete = (params?: WecharPriceModel | any) =>
  defHttp.get<WecharPriceModel>({ url: adminPath + '/setting/pricemodel/wecharPriceModel/delete', params });


export const wecharPriceModelImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/setting/pricemodel/wecharPriceModel/importData',
      onUploadProgress,
    },
    params,
  );

  export const wecharPriceModelSelListData = (params?: WecharPriceModel | any) =>
    defHttp.post<Page<WecharPriceModel>>({ url: adminPath + '/setting/pricemodel/wecharPriceModel/selListData', params });